package com.ibm.spatiotemp.server.datamodel.tenant;

import java.util.HashMap;

import org.apache.log4j.Logger;

import com.ibm.spatiotemp.server.datasources.DataSource;

public class Tenant {
	public static Logger logger = Logger.getLogger(Tenant.class);
	
	protected String tenantid;

	/*for furture to upload user's data driver jars*/
	protected String tenantlibpath;
	
	/*key: source's sourcename*/
	protected HashMap<String, DataSource> datasources;
	
	public Tenant()
	{
		datasources = new HashMap<String, DataSource>();
	}
	public String getTenantlibpath() {
		return tenantlibpath;
	}

	public void setTenantlibpath(String tenantlibpath) {
		this.tenantlibpath = tenantlibpath;
	}

	public void upsetDataSource(DataSource src){
		datasources.put(src.getSrcname(), src);
	}
	
	public void removeDataSource(DataSource src)
	{
		datasources.remove(src.getSrcname());
	}
	
	public DataSource getDataSourceBySourceName(String srcname)
	{
		return datasources.get(srcname);
	}
	
	public String getTenantid() {
		return tenantid;
	}

	public void setTenantid(String tenantid) {
		this.tenantid = tenantid;
	}
}
